package oo_day05;

public class EnumDemo {
    public static void main(String[] args) {
        Season s = Season.WINTER;
        System.out.println(s.getSeasonName());
        switch (s) {
            case SPRING:
                System.out.println("天气" + s.getSeasonDesc()+"我们去春游吧!");
                break;
            case SUMMER:
                System.out.println("天气"+s.getSeasonDesc()+"我们去游泳吧!");
                break;
            case AUTUMN:
                System.out.println("天气"+s.getSeasonDesc()+"我们去秋游吧!");
                break;
            case WINTER:
                System.out.println("天气"+s.getSeasonDesc()+"我们去暖暖吧!");
                break;
        }
        //values()方法以数组方式返回枚举类型中的成员
        Season[]seasons = Season.values();//获取所有枚举的对象
        for (int i = 0; i < seasons.length; i++) {
            System.out.println(seasons[i]);
            System.out.println(seasons[i].getSeasonName());
            System.out.println(seasons[i].getSeasonDesc());
        }
    }
}
